home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_rotate.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  100 lines

  1. # Jones 3D Cog Script
  2. #
  3. # nub_Rotate.cog
  4. #
  5. # [RKD] [TL] [GGJ]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message    arrived
  13. message    crossed
  14. message    entered
  15.  
  16. thing    gear0
  17. thing    gear1
  18. thing    gear2
  19. thing    gear3
  20. thing    gear4
  21. thing    gear5
  22. thing    gear6
  23.  
  24. surface    soundon
  25. surface    soundoff
  26.  
  27. sector    soundLow
  28. sector    soundHi
  29.  
  30. sound    gearmove=nub_gears_moving_c.wav    local
  31. int        gearchannel                        local
  32. int        stopflag=1                        local
  33. int        soundVol=0                        local
  34.  
  35. end
  36.  
  37. # ========================================================================================
  38. code
  39.  
  40. crossed:
  41.  
  42. if (GetSenderRef() == soundon)
  43. {
  44.     stopflag = 0;
  45.     gearchannel = PlaySoundThing(gearmove, gear3, 1.0, 5.0, 20.0, 0x881);
  46.     Rotate(gear0, -360, 0, 4.0);
  47.     Rotate(gear1, 360, 0, 2.0);
  48.     Rotate(gear2, -360, 0, 1.0);
  49.     Rotate(gear3, 360, 0, 8.0);
  50.     Rotate(gear4, -360, 0, 1.0);
  51.     Rotate(gear5, 360, 0, 4.0);
  52.     Rotate(gear6, -360, 0, 4.0);
  53.     return;
  54. }
  55. if (GetSenderRef() == soundoff)
  56. {
  57.     stopflag = 1;
  58.     StopSound(gearchannel, 0);
  59.     return;
  60. }
  61. return;
  62. #........................................................................................
  63. entered:
  64.  
  65. if (GetSenderRef() == soundLow)
  66. {
  67.     if (soundVol == 1) return;
  68.     ChangeSoundVol(gearchannel, 0.35, 3.0);
  69.     soundVol=1;
  70.     return;
  71. }
  72. if (GetSenderRef() == soundHi)
  73. {
  74.     if (soundVol == 2) return;
  75.     ChangeSoundVol(gearchannel, 1.0, 3.0);
  76.     soundVol=2;
  77.     return;
  78. }
  79.  
  80. return;
  81.  
  82. #........................................................................................
  83. arrived:
  84.  
  85. if (stopflag == 1) return;
  86.  
  87. Rotate(gear0, -360, 0, 4.0);
  88. Rotate(gear1, 360, 0, 2.0);
  89. Rotate(gear2, -360, 0, 1.0);
  90. Rotate(gear3, 360, 0, 8.0);
  91. Rotate(gear4, -360, 0, 1.0);
  92. Rotate(gear5, 360, 0, 4.0);
  93. Rotate(gear6, -360, 0, 4.0);
  94.  
  95. return;
  96.  
  97. #........................................................................................
  98. end
  99.  
  100.